/*

Author   : chaos

FileName : file_out.cpp

Date     : 16/08/17 11:21:13

*/
#include <iostream>
#include <fstream>
using namespace std;

#define FILEPATH "Reader.txt"
int main(int argc ,char *argv[])
{
    fstream file;
    char * str[4] = {"Mary", "John","Judy","Joe"};
    int id[4] = {100,200,300,400};

    file.open(FILEPATH,ios::out);

    if(!file)
    {
         cerr << "Can't open file!" << endl;
    }
    for(int i = 1; i < 4; i++)
    {
        file << id[i] << " " << str[i] << endl;
    }
    return 0;
}
